package com.yanqu.road.server.manger.assistant.handler;

import com.yanqu.road.pb.assistant.AssistantProto;
import com.yanqu.road.pb.zhaoshang.ZhaoShangProto;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.assistant.AssistantMgr;
import com.yanqu.road.server.manger.assistant.CrossActionHandler;

import java.util.List;

/**
 * 小助手招商跨服处理
 *
 * @author hyx
 */
public class ZsCrossActionHandler extends CrossActionHandler {

    public ZsCrossActionHandler() {
        this.success = false;
    }

    @Override
    protected void action(GamePlayer player, AssistantProto.AssistantActionReqMsg.Builder reqMsg, AssistantProto.AssistantActionRespMsg.Builder respMsg) {
        if (AssistantMgr.includeZsAction(reqMsg.getOperateEnumList())) {
            int ret = AssistantMgr.zsAction(player, reqMsg, respMsg);
            if (ret == 0) {
                success = true;
            } else {
                success = false;
            }
        }
    }

    @Override
    protected void nextHandler(GamePlayer player, AssistantProto.AssistantActionReqMsg.Builder reqMsg, AssistantProto.AssistantActionRespMsg.Builder respMsg) {
        new UnionCrossActionHandler().handle(player, reqMsg, respMsg);
    }
}
